<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>这是判断奇偶代码</title>
</head>
<body>
<script>
  for(var i=1;i<=20;i++)
  {
    if(i%2==0)
    {
      document.write(i+"是偶数"+'<br/>');
    }else {
      document.write(i+"是奇数"+'<br/>');
    }
  }
</script>
</body>
</html>